package api

import (
	"github.com/gin-gonic/gin"
	"zk12.27/api/handler"
	"zk12.27/pkg"
)

func Route(r *gin.Engine) {
	user := r.Group("/user")
	{
		user.POST("/useradd", handler.UserAdd)
		user.POST("/userup", handler.UserUp)

	}
	live := r.Group("/live")
	{
		live.Use(pkg.JWTAuth("2210c"))
		live.POST("/liveadd", handler.LiveAdd)
		live.POST("/livelist", handler.LiveList)
		live.POST("/liveupdate", handler.LiveUpdate)
		live.POST("/livedelete", handler.LiveDelete)
	}
	message := r.Group("/message")
	{
		message.Use(pkg.JWTAuth("2210c"))
		message.POST("/messageadd", handler.MessageAdd)
		message.POST("/messagelist", handler.MessageList)
		message.POST("/messageupdate", handler.MessageUpdate)
		message.POST("/messagedelete", handler.MessageDelete)
	}
	gift := r.Group("/gift")
	{
		gift.Use(pkg.JWTAuth("2210c"))
		gift.POST("/giftadd", handler.GiftAdd)
		gift.POST("/giftlist", handler.GiftList)
		gift.POST("/giftupdate", handler.GiftUpdate)
		gift.POST("/giftdelete", handler.GiftDelete)
	}
}
